home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Guided Tour of Multimedia (Second Edition)
/
The Guided Tour of Multimedia (Second Edition).iso
/
trials
/
director
/
evalcopy
/
director.z
/
NAVIGATR.DIR
/
00456_Field_456.txt
< prev
next >
Wrap
Text File
|
1994-06-14
|
1KB
|
40 lines
MECH , 77
--=================================================================
-- This handler manages the speed control. The mouse position
-- is determined relative to the general height of the sprite
-- and a cast (PICT) is selected for the sprite.
-- The delay property var is set to a value of 0 - 7.
on mSetSpeed me
put the mouseV into vertPos
-- each cast member in this animation has a different height,
-- so I have experimented and I've found the following numbers
-- yeild the best results for this control
set bottomRange = 290
set totalRange = 35
set delta = totalRange / 7
set rangeMark = (((vertPos - bottomRange) / delta))
set rangeMark = min(rangeMark,7)
if rangeMark < 0 then set rangeMark = 0
set newCast = (158 - rangeMark)
put the castNum of sprite 27 into currentCast
if currentCast > newCast then
set fDelta = -1
else
set fDelta = 1
end if
repeat while currentCast <> newCast
set currentCast = currentCast + fDelta
set the castNum of sprite 27 = currentCast
updateStage
end repeat
set mySpeed = rangeMark
set theDelay = mySpeed
set delayCounter = theDelay
end mSetSpeed